<?php
/*********************************************
 *  CPG Dragonfly™ CMS
 *********************************************
	Copyright © since 2010 by CPG-Nuke Dev Team
	http://dragonflycms.org

	Dragonfly is released under the terms and conditions
	of the GNU GPL version 2 or any later version
*/

namespace Poodle;

abstract class LOG
{
	const
		CREATE  = 1, # created data
		MODIFY  = 2, # edited data. NOTE: don't confuse with UPDATE
		DELETE  = 3, # removed data. TIP: place deleted data in message
		UPDATE  = 4, # like forum prune, to bring something 'up to date'
		MOVE    = 5, # moved data. TIP: place 'moved from' in message
		MERGE   = 6,
		SPLIT   = 7,
		APPROVE = 8,
		DENY    = 9,
		FLASH   = 10,
		LOGIN   = 11,
		SMS     = 12;
	public static function debug  ($type, $msg, $lh=false) { self::insert(1, $type, $msg, $lh); }
	public static function event  ($type, $msg, $lh=false) { self::insert(2, $type, $msg, $lh); }
	public static function notice ($type, $msg, $lh=false) { self::insert(3, $type, $msg, $lh); }
	public static function warning($type, $msg, $lh=false) { self::insert(4, $type, $msg, $lh); }
	public static function error  ($type, $msg, $lh=true)  { self::insert(5, $type, $msg, $lh); }
	protected static function insert($level, $type, $msg, $log_headers=false)
	{
		trigger_error("Dragonfly LOG: $type, $msg");
	}
}
